<template>
    <van-row>
  <van-col span="6" style="height: 100%; overflow: auto;">
    <van-sidebar v-model="active">
        <div v-for="item in categoriesApiData">
              <van-sidebar-item :title="item.cat_name" />
        </div>

</van-sidebar>
  </van-col>
  <van-col span="18" style="height: 100%; overflow: auto;">
    <div v-for="item in categoriesApiData[active]?.children">
            <h4>{{ item.cat_name }}</h4>
            <van-grid :border="false" :column-num="5">
  <van-grid-item v-for="item in item.children">
    <router-link :to="'/lb/'+item.cat_name">
    <van-image
      :src="item.cat_icon"
    />
    <h5>{{ item.cat_name }}</h5>
</router-link>
  </van-grid-item>
</van-grid>
    </div>
  </van-col>
</van-row>
</template>

<script setup>
import { ref } from 'vue';
import { categoriesApi } from '@/api/app'
const categoriesApiData=ref([])

categoriesApi().then(res=>{
    console.log('数据',res);
    categoriesApiData.value=res.data.message
})
    const active = ref(1);
</script>

<style lang="scss" scoped>

</style>